<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/include/tagtld.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script src="${ctx}/js/jquery-1.4.2.js" type="text/javascript"></script>
</head>
<body>
	<table>
		<tr><th>菜单ID</th><th>菜单name</th><th>功能status</th><th>功能级别</th><th>父功能ID</th><th>功能URL</th><th>图标1</th><th>图标2</th><th>图标3</th></tr>
		<c:forEach var="menu" items="${menus}">
		<tr><td>${menu.menuId }</td><td>${menu.menuId }</td><td>${menu.menuStatus }</td><td>${menu.menuLevel }</td><td>${menu.menuIdP }</td><td>${menu.menuUrl }</td><td>${menu.menuIcon1 }</td><td>${menu.menuIcon2 }</td><td>${menu.menuIcon3 }</td></tr>
		</c:forEach>
	</table>
	<form id="menuForm" name="menuForm" action="${ctx }/menu/menuPostDo.htm" method="post">
	<table>
		<tr>
			<td>菜单ID</td><td><input type="text" name="menu.menuId" id="menuId" /></td>	
		</tr>
		<tr>
			<td>菜单name</td><td><input type="text" name="menu.menuName" id="menuName" /></td>	
		</tr>
		<tr>
			<td>功能status</td><td><input type="text" name="menu.menuStatus" id="menuStatus" /></td>	
		</tr>
		<tr>
			<td>功能级别</td><td><input type="text" name="menu.menuLevel" id="menuLevel" /></td>	
		</tr>
		<tr>
			<td>父功能ID</td><td><input type="text" name="menu.menuIdP" id="menuIdP" /></td>	
		</tr>
		<tr>
			<td>功能URL</td><td><input type="text" name="menu.menuUrl" id="menuUrl" /></td>	
		</tr>
		<tr>
			<td>图标1</td><td><input type="text" name="menu.menuIcon1" id="menuIcon1" /></td>	
		</tr>
		<tr>
			<td>图标2</td><td><input type="text" name="menu.menuIcon2" id="menuIcon2" /></td>	
		</tr>
		<tr> 
			<td>图标3</td><td><input type="text" name="menu.menuIcon3" id="menuIcon3" /></td>	
		</tr>
		<tr>
			<td><input type="submit" value="post提交" /></td><td><input type="button" value="ajax提交" onclick="ajaxdo()" /></td>
		</tr>
		
	</table>
	</form>
</body>
<script type="text/javascript">
	function ajaxdo() {
		var data = jQuery("#menuForm").serialize();
		jQuery.ajax({
			url : "${ctx}/menu/menuAjaxDo.htm",
			data : data,
			success : function(d){
				alert("the menu name is " + d.menu.menuName + " and the sessionId is " + d.sessionId);
			}
		});
	}
</script>
</html>